Script: MySQL Interface for mIRC v1.3
Author: MonoTeK
Date  : 2004/10/04
Email : monotek@psiblade.net


Commands:
====================================================================================

Command:	mysql
		mysql_gui
Information:	Opens the built-in MySQL Interface GUI
-
Command:	mysql_connect [server] [port] [database] [username] [pass]
		mysql_open [server] [port] [database] [username] [pass]
Information:	Open a connection to a MySQL Server
		- If you don't specify any of these values, the defaults set in config will be used.
		- Use '' to indicate there is no password
Example:	mysql_connect mysql.server.com 3306 mydatabase guest ''
-
Command:	mysql_disconnect
		mysql_close
Information:	Disconnect from the MySQL server
-
Command:	mysql_use <database> [data to pass]
Information:	Change to the specified database and optionally pass along data that will be returned in the signal event
Example:	mysql_use NewsScript
-
Command:	mysql_query <query name> <SQL query>
Information:	Execute an SQL query
Examples:	mysql_query getnews Select * from tblNews
		mysql_query addnews Insert into tblNews Values ('','New Script Out!','This script does a lot of things blahblahblah...','MonoTeK')
-
Command:	mysql_param <query name> <parameter name> <parameter data>
Information:	Set a parameter to be retrieved in the mysql signal or any other script
		This command must be used after initiating a query or it won't be passed.
		NOTE: All old parameters are cleared when a new query is run
Example:	mysql_query getnews Select * from tblNews
		mysql_param getnews nick Ketonom
		mysql_param getnews channel #mircscripts
-
Command:	mysql_clear
Information:	Clears the current result set
-


Aliases:
====================================================================================
Alias:		$mysql_escape(<text>)
Information:	This will add escape characters before quotes and backslashes.
Usage:		The main point of this is to prevent characters like ', ", and \ from interrupting queries
		You will want to make sure you don't run the actual query through just, just the text data
Example:	mysql_query testquery Select * from login where userid = ' $+ $mysql_escape($1-) $+ '
-
Alias:		$mysql_getfield(Column/N,R)
Information:	This will return a single field at the specified coordinates in the result set
Usage:		'Column/N' is either the actual column name or the column number.
		The second parameter 'R' is what row to retrieve the field from.
Example:	var %field = $mysql_getfield(ItemID,2)
-
Alias:		$mysql_getparam(QueryName,ParameterName)
Information:	This will return a parameter that was passed by the mysql_param command
Example:	var %channel = $mysql_getparam(getnews,channel)
-
Alias:		$mysql_getcol(Column/N)
Information:	Retrieves a column's name or number.
Usage:		'Column/N' is either the actual column name or the column number.
Example:	var %colname = $mysql_getcol(5)
-
Alias:		$mysql_colcount
Information:	Returns the number of columns in a result set.
Example:	echo There were $mysql_colcount columns returned in your last query.
-
Alias:		$mysql_rowcount
Information:	Returns the number of rows in a result set.
Example:	echo There were $mysql_rowcount rows returned in your last query.
-
Alias:		$mysql_rows_affected
Information:	Returns the number of rows affected by the last query.
Example:	echo There were $mysql_rows_affected rows affected by your last query.
-
Alias:		$mysql_status
Information:	Returns the status of the connection to the server. (Either 0 or 1)
Example:	if ($mysql_status) echo Connected and logged in to the MySQL server.
-
Alias:		$mysql_error
Information:	Returns the last mysql error message or $null if there wasn't an error.
Example:	if ($mysql_error) echo Received the following error while running the query: $mysql_error
-
Alias:		$mysql_cwindow
Information:	Returns $true if output to @MySQL is enabled, otherwise $false
-
Alias:		$mysql_verbose
Information:	Returns $true if Verbose mode is enabled, otherwise $false
-
Alias:		$mysql_debug
Information:	Returns $true if Debug Output mode is enabled, otherwise $false
-
Alias:		$mysql_htmlout
Information:	Returns $true if HTML Results Output mode is enabled, otherwise $false
-
Alias:		$mysql_htmlout.file
Information:	Returns the path and filename for the HTML output file.
-
Alias:		$mysql_htmlout.run
Information:	Returns $true if HTML Results will be displayed after processing, otherwise $false
-


Remotes:
====================================================================================

Something new in mIRC 6 is the 'on SIGNAL' remote.  When a query has finished, it will trigger
a signal named 'mysql' which can be picked up by this remote.

Current signal parameters returned in $1-:
QUERY <query name>		// A query has completed successfully
QUERY <query name> <n>		// A query has completed successfully and affected <n> rows
QUERY ERROR <query name>	// A query has not completed successfully
OK				// Last command completed successfully
OK <data>			// Last command completed successfully and <data> was passed from a mysql_use command
OK mysql_logged_in		// Successfully logged in and changed database
ERROR				// Last command did not complete successfully
